﻿@model IEnumerable<SisGAC.Models.Pessoa>

<h2>@ViewBag.Title</h2>

<p>
    @if (ViewBag.Autor) {
        @Html.ActionLink("Cadastrar Autor", "Cadastro", new { autor = true }, null)
    }
    else {
        @Html.ActionLink("Cadastrar Pessoa", "Cadastro")
    }
</p>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.CPF)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Nome)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Email)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Instituicao)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.CPF)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Nome)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Email)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Instituicao)
        </td>
        <td>
            @Html.ActionLink("Editar", "Cadastro", new { id=item.PessoaId }) |
            @Html.ActionLink("Detalhes", "Details", new { id=item.PessoaId }) |
            @Html.ActionLink("Excluir", "Delete", new { id=item.PessoaId }) |
            @if (item.Avaliador)
            {
                @Html.ActionLink("Atribuir Áreas", "AtribuirAreas", new { id=item.PessoaId })
            }
        </td>
    </tr>
}

</table>
